package com.eeboot.vo;

import com.eeboot.util.DateUtil;

public class Log {
    public String app;
    public String profile;
    public String hostName;
    public String ip;
    public String logTime;
    public String logThread;
    public String tid;
    public String spid;
    public String logLevel;
    public String logData;
    public String message;
    public Long logTimeLong;

    public static Log of(String app, String profile, String hostName, String ip, String logTime, String logThread, String tid, String spid, String logLevel, String logData){
        Log log = new Log();
        log.app=app;
        log.profile=profile;
        log.hostName=hostName;
        log.ip=ip;
        log.logTime=logTime;
        log.logThread=logThread;
        log.tid=tid;
        log.spid=spid;
        log.logLevel=logLevel;
        log.logData=logData;
        log.logTimeLong=DateUtil.getLong("yyyy-MM-dd HH:mm:ss.SSS", logTime);
        return log;
    }

    public String toString(){
        return new StringBuffer()
                .append(app).append(" ")
                .append(profile).append(" ")
                .append(hostName).append(" ")
                .append(ip).append(" ")
                .append(logTime).append(" ")
                .append(logThread).append(" ")
                .append(tid).append(" ")
                .append(spid).append(" ")
                .append(logLevel).append(" ")
                .append(logData).append(" ")
                .toString();
    }
}
